<include file="Public:head" />
<include file="Public:header" />
<include file="Public:left" />

<section id='content'>
<div class='container-fluid'>
<div class='row-fluid' id='content-wrapper'>
<div class='span12'>
<div class='row-fluid'>
    <div class='span12'>
        <div class='page-header'>
            <h1 class='pull-left'>
                <i class='icon-table'></i>
                <span>职位列表</span>
            </h1>
            
        </div>
    </div>
</div>

<div class='row-fluid'>
   <div class='span12'>
            <div class='pull-right'>
                <form action="{:U('Company/company_job_list')}" method="post" style="margin:0px;">
                    <input id="search_key" placeholder="企业关键字" type="text" name="company_name">
                    <input type="submit" value="搜索" name="sub" style="margin-bottom:10px;">
                </form>
        </div>
    </div>
</div>


<div class='row-fluid'>
    <div class='span12 box bordered-box blue-border' style='margin-bottom:0;'>
        <div class='box-header blue-background'>
            <div class='title'>职位列表</div>
            
        </div>
        <div class='box-content box-no-padding'>
            <div class='responsive-table'>
                <div class='scrollable-area'>
                    <table class='table' style='margin-bottom:0;'>
                        <thead>
                        <tr>
                            <th>职位ID</th>
                            <th>职位名称</th>
                            <th>企业名称</th>
                            <th>职位状态</th>
                            <th>刷新时间</th>
                            <th>结束时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                            <volist name="hirings.data" id="h">
                                <tr>
                                    <td>{$h.hiring_id}</td>                                 
                                    <td>{$h.title}</td>
                                    <td>{$h.company}</td>
                                    <td>
                                        <eq name="h.is_del" value="1">
                                            <font color="red">已删除</font>
                                            <else/>
										<switch name="h.status">
											<case value="1" break="1">正常显示</case>
											<case value="0" break="1"><font color="blue">等待审核</font></case>
										</switch>
                                    </eq>
									</td>
                                    <td>{$h.updateline|date="Y-m-d H:i",###}</td>
                                    <td>{$h.etime|date="Y-m-d H:i",###}</td>
                                    <td>
                                        <div class='text-left'>
                                            <eq name="h.status" value="1">
                                            <a class='btn btn-info btn-mini has-tooltip' data-placement="top" title="点击转为待审核状态" href='' onclick="status({$h.hiring_id},'0')">
                                            <else/>
                                            <a class='btn btn-info btn-mini has-tooltip' data-placement="top" title="点击审核通过" href='' onclick="status({$h.hiring_id},'1')">
                                            </eq> 
                                                <i class='icon-retweet'></i>
                                            </a>
                                            <a class='btn btn-success btn-mini' href='__URL__/company_job_edit/hiring_id/{$h.hiring_id}'>
                                                <i class='icon-pencil'></i>
                                            </a>
                                            <a class='btn btn-danger btn-mini'  onclick="del_jobs({$h.hiring_id});">
                                                <i class='icon-remove' ></i>
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                
                            </volist>
                            <script type="text/javascript">
                                function del_jobs(val){
                                    $.post("__URL__/del_jobs", { "id": val},
                                       function(data){
                                        if (data.status==1) {
                                          location.replace(location.href);  }
                                       }, "json");
                                            
                                } 
                                function status(id,val){
                                    $.post("__URL__/edit_hiring_status", { "id": id,"val":val},
                                       function(data){
                                        if (data.status==1) {
                                          location.replace(location.href);  }
                                       }, "json");
                                            
                                }         
                                </script>
                        </tbody>
                    </table>
                    <div>
                            {$hirings.html}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</div>
</div>
</div>
</section>
</div>

<include file="Public:bottom" />
<script type="text/javascript">
    $(document).ready(function () {
      $("ul[class='nav nav-stacked']").removeClass('in');
      $("#jobs").addClass('in');
      $("li[class='guan']").removeClass('active');
      $("#company_job_list").addClass('active');
    });
</script>